package logger

import (
	"fmt"

	"go.uber.org/zap"
)

var zapLog *zap.Logger

func InitLogger() {
	var err error
	zapLog, err = zap.NewProduction(zap.AddCaller())
	if err != nil {
		panic(err)
	}
}

func DEBUG(format string, v ...interface{}) {
	log := fmt.Sprintf(format, v...)
	zapLog.Debug(log)
}

func INFO(format string, v ...interface{}) {
	log := fmt.Sprintf(format, v...)
	zapLog.Info(log)
}

func WARN(format string, v ...interface{}) {
	log := fmt.Sprintf(format, v...)
	zapLog.Warn(log)
}
func ERROR(format string, v ...interface{}) {
	log := fmt.Sprintf(format, v...)
	zapLog.Error(log)
}
